<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateCommentTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('comment', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->bigInteger('company_id')->comment('公司ID');
            $table->bigInteger('order_in')->comment('订单ID');
            $table->bigInteger('user_id')->comment('用户ID');
            $table->bigInteger('driver_id')->comment('司机ID');
            $table->integer('service_id')->nullable()->comment('服务类别ID');
            $table->integer('service_type_id')->nullable()->comment('服务类型ID');
            $table->integer('score')->default(5)->comment('分数');
            $table->string('remark')->nullable()->comment('备注');
            $table->timestamps();
        });
        \DB::statement("ALTER TABLE `comment` comment '评价表'");

    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('comment');
    }
}
